FROM rocker/verse:3.6.0

# Install R packages (besides tidyverse)
RUN echo "options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/2019-06-01/'))" >> /usr/local/lib/R/etc/Rprofile.site
RUN install2.r --error Amelia assertr countrycode foreach Formula geosphere maxLik randtoolbox Rcpp WDI

# Directory to run everything in
ARG base=/tmp/replication
WORKDIR ${base}

# Directory structure
RUN mkdir -p \
    ${base} \
    ${base}/results \
    ${base}/figures \
    ${base}/tables
